package androidx.test.espresso;

import android.os.Looper;
import androidx.test.espresso.base.ActiveRootLister;
import androidx.test.espresso.base.BaseLayerModule;
import androidx.test.espresso.base.BaseLayerModule_FailureHandlerHolder_Factory;
import androidx.test.espresso.base.BaseLayerModule_ProvideActiveRootListerFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideCompatAsyncTaskMonitorFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideDynamicNotiferFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideEventInjectorFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideFailureHanderFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideFailureHandlerFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideLifecycleMonitorFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideMainLooperFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideMainThreadExecutorFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideRemoteExecutorFactory;
import androidx.test.espresso.base.BaseLayerModule_ProvideSdkAsyncTaskMonitorFactory;
import androidx.test.espresso.base.IdlingResourceRegistry;
import androidx.test.espresso.base.IdlingResourceRegistry_Factory;
import androidx.test.espresso.base.RootViewPicker;
import androidx.test.espresso.base.RootViewPicker_Factory;
import androidx.test.espresso.base.RootViewPicker_RootResultFetcher_Factory;
import androidx.test.espresso.base.RootsOracle_Factory;
import androidx.test.espresso.base.ThreadPoolExecutorExtractor_Factory;
import androidx.test.espresso.base.UiControllerImpl_Factory;
import androidx.test.espresso.base.UiControllerModule;
import androidx.test.espresso.base.UiControllerModule_ProvideUiControllerFactory;
import androidx.test.espresso.base.ViewFinderImpl;
import androidx.test.espresso.base.ViewFinderImpl_Factory;
import androidx.test.espresso.core.internal.deps.dagger.internal.DoubleCheck;
import androidx.test.espresso.core.internal.deps.dagger.internal.Preconditions;
import androidx.test.espresso.core.internal.deps.guava.util.concurrent.ListeningExecutorService;
import java.util.concurrent.Executor;
import javax.inject.Provider;

/* loaded from: classes.dex */
public final class DaggerBaseLayerComponent implements BaseLayerComponent {
    private BaseLayerModule baseLayerModule;
    private Provider<BaseLayerModule.FailureHandlerHolder> failureHandlerHolderProvider;
    private Provider<IdlingResourceRegistry> idlingResourceRegistryProvider;
    private BaseLayerModule_ProvideActiveRootListerFactory provideActiveRootListerProvider;
    private Provider provideCompatAsyncTaskMonitorProvider;
    private BaseLayerModule_ProvideDynamicNotiferFactory provideDynamicNotiferProvider;
    private Provider provideEventInjectorProvider;
    private BaseLayerModule_ProvideFailureHanderFactory provideFailureHanderProvider;
    private BaseLayerModule_ProvideLifecycleMonitorFactory provideLifecycleMonitorProvider;
    private Provider<Looper> provideMainLooperProvider;
    private Provider<Executor> provideMainThreadExecutorProvider;
    private Provider<ListeningExecutorService> provideRemoteExecutorProvider;
    private Provider provideSdkAsyncTaskMonitorProvider;
    private Provider<UiController> provideUiControllerProvider;
    private RootsOracle_Factory rootsOracleProvider;
    private Provider threadPoolExecutorExtractorProvider;
    private Provider uiControllerImplProvider;

    private DaggerBaseLayerComponent(Builder builder) {
        initialize(builder);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static BaseLayerComponent create() {
        return new Builder().build();
    }

    private Object getRootsOracle() {
        return RootsOracle_Factory.newRootsOracle(this.provideMainLooperProvider.get());
    }

    private void initialize(final Builder builder) {
        BaseLayerModule_ProvideFailureHanderFactory create = BaseLayerModule_ProvideFailureHanderFactory.create(builder.baseLayerModule);
        this.provideFailureHanderProvider = create;
        this.failureHandlerHolderProvider = DoubleCheck.provider(BaseLayerModule_FailureHandlerHolder_Factory.create(create));
        this.baseLayerModule = builder.baseLayerModule;
        Provider<Looper> provider = DoubleCheck.provider(BaseLayerModule_ProvideMainLooperFactory.create(builder.baseLayerModule));
        this.provideMainLooperProvider = provider;
        this.idlingResourceRegistryProvider = DoubleCheck.provider(IdlingResourceRegistry_Factory.create(provider));
        this.provideEventInjectorProvider = DoubleCheck.provider(BaseLayerModule_ProvideEventInjectorFactory.create(builder.baseLayerModule));
        this.threadPoolExecutorExtractorProvider = DoubleCheck.provider(ThreadPoolExecutorExtractor_Factory.create(this.provideMainLooperProvider));
        this.provideSdkAsyncTaskMonitorProvider = DoubleCheck.provider(BaseLayerModule_ProvideSdkAsyncTaskMonitorFactory.create(builder.baseLayerModule, this.threadPoolExecutorExtractorProvider));
        this.provideCompatAsyncTaskMonitorProvider = DoubleCheck.provider(BaseLayerModule_ProvideCompatAsyncTaskMonitorFactory.create(builder.baseLayerModule, this.threadPoolExecutorExtractorProvider));
        BaseLayerModule_ProvideDynamicNotiferFactory create2 = BaseLayerModule_ProvideDynamicNotiferFactory.create(builder.baseLayerModule, this.idlingResourceRegistryProvider);
        this.provideDynamicNotiferProvider = create2;
        this.uiControllerImplProvider = DoubleCheck.provider(UiControllerImpl_Factory.create(this.provideEventInjectorProvider, this.provideSdkAsyncTaskMonitorProvider, this.provideCompatAsyncTaskMonitorProvider, create2, this.provideMainLooperProvider, this.idlingResourceRegistryProvider));
        this.provideUiControllerProvider = DoubleCheck.provider(UiControllerModule_ProvideUiControllerFactory.create(builder.uiControllerModule, this.uiControllerImplProvider));
        this.provideMainThreadExecutorProvider = DoubleCheck.provider(BaseLayerModule_ProvideMainThreadExecutorFactory.create(builder.baseLayerModule, this.provideMainLooperProvider));
        this.rootsOracleProvider = RootsOracle_Factory.create(this.provideMainLooperProvider);
        this.provideActiveRootListerProvider = BaseLayerModule_ProvideActiveRootListerFactory.create(builder.baseLayerModule, this.rootsOracleProvider);
        this.provideLifecycleMonitorProvider = BaseLayerModule_ProvideLifecycleMonitorFactory.create(builder.baseLayerModule);
        this.provideRemoteExecutorProvider = DoubleCheck.provider(BaseLayerModule_ProvideRemoteExecutorFactory.create(builder.baseLayerModule));
    }

    @Override // androidx.test.espresso.BaseLayerComponent
    public BaseLayerModule.FailureHandlerHolder failureHolder() {
        return this.failureHandlerHolderProvider.get();
    }

    @Override // androidx.test.espresso.BaseLayerComponent
    public FailureHandler failureHandler() {
        return BaseLayerModule_ProvideFailureHandlerFactory.proxyProvideFailureHandler(this.baseLayerModule, this.failureHandlerHolderProvider.get());
    }

    @Override // androidx.test.espresso.BaseLayerComponent
    public ActiveRootLister activeRootLister() {
        return BaseLayerModule_ProvideActiveRootListerFactory.proxyProvideActiveRootLister(this.baseLayerModule, getRootsOracle());
    }

    @Override // androidx.test.espresso.BaseLayerComponent
    public IdlingResourceRegistry idlingResourceRegistry() {
        return this.idlingResourceRegistryProvider.get();
    }

    @Override // androidx.test.espresso.BaseLayerComponent
    public UiController uiController() {
        return this.provideUiControllerProvider.get();
    }

    @Override // androidx.test.espresso.BaseLayerComponent
    public Executor mainThreadExecutor() {
        return this.provideMainThreadExecutorProvider.get();
    }

    @Override // androidx.test.espresso.BaseLayerComponent
    public ViewInteractionComponent plus(ViewInteractionModule module) {
        return new ViewInteractionComponentImpl(module);
    }

    /* loaded from: classes.dex */
    public static final class Builder {
        private BaseLayerModule baseLayerModule;
        private UiControllerModule uiControllerModule;

        private Builder() {
        }

        public BaseLayerComponent build() {
            if (this.baseLayerModule == null) {
                this.baseLayerModule = new BaseLayerModule();
            }
            if (this.uiControllerModule == null) {
                this.uiControllerModule = new UiControllerModule();
            }
            return new DaggerBaseLayerComponent(this);
        }

        public Builder baseLayerModule(BaseLayerModule baseLayerModule) {
            this.baseLayerModule = (BaseLayerModule) Preconditions.checkNotNull(baseLayerModule);
            return this;
        }

        public Builder uiControllerModule(UiControllerModule uiControllerModule) {
            this.uiControllerModule = (UiControllerModule) Preconditions.checkNotNull(uiControllerModule);
            return this;
        }
    }

    /* loaded from: classes.dex */
    private final class ViewInteractionComponentImpl implements ViewInteractionComponent {
        private ViewInteractionModule_ProvideNeedsActivityFactory provideNeedsActivityProvider;
        private ViewInteractionModule_ProvideRootMatcherFactory provideRootMatcherProvider;
        private ViewInteractionModule_ProvideRootViewFactory provideRootViewProvider;
        private RootViewPicker_RootResultFetcher_Factory rootResultFetcherProvider;
        private Provider<RootViewPicker> rootViewPickerProvider;
        private ViewInteractionModule viewInteractionModule;

        private ViewInteractionComponentImpl(ViewInteractionModule module) {
            initialize(module);
        }

        private ViewFinderImpl getViewFinderImpl() {
            return ViewFinderImpl_Factory.newViewFinderImpl(ViewInteractionModule_ProvideViewMatcherFactory.proxyProvideViewMatcher(this.viewInteractionModule), this.provideRootViewProvider);
        }

        private ViewFinder getViewFinder() {
            return ViewInteractionModule_ProvideViewFinderFactory.proxyProvideViewFinder(this.viewInteractionModule, getViewFinderImpl());
        }

        private void initialize(final ViewInteractionModule module) {
            ViewInteractionModule viewInteractionModule = (ViewInteractionModule) Preconditions.checkNotNull(module);
            this.viewInteractionModule = viewInteractionModule;
            this.provideRootMatcherProvider = ViewInteractionModule_ProvideRootMatcherFactory.create(viewInteractionModule);
            this.rootResultFetcherProvider = RootViewPicker_RootResultFetcher_Factory.create(DaggerBaseLayerComponent.this.provideActiveRootListerProvider, this.provideRootMatcherProvider);
            this.provideNeedsActivityProvider = ViewInteractionModule_ProvideNeedsActivityFactory.create(this.viewInteractionModule);
            Provider<RootViewPicker> provider = DoubleCheck.provider(RootViewPicker_Factory.create(DaggerBaseLayerComponent.this.provideUiControllerProvider, this.rootResultFetcherProvider, DaggerBaseLayerComponent.this.provideLifecycleMonitorProvider, this.provideNeedsActivityProvider));
            this.rootViewPickerProvider = provider;
            this.provideRootViewProvider = ViewInteractionModule_ProvideRootViewFactory.create(this.viewInteractionModule, provider);
        }

        @Override // androidx.test.espresso.ViewInteractionComponent
        public ViewInteraction viewInteraction() {
            return new ViewInteraction((UiController) DaggerBaseLayerComponent.this.provideUiControllerProvider.get(), getViewFinder(), (Executor) DaggerBaseLayerComponent.this.provideMainThreadExecutorProvider.get(), DaggerBaseLayerComponent.this.failureHandler(), ViewInteractionModule_ProvideViewMatcherFactory.proxyProvideViewMatcher(this.viewInteractionModule), ViewInteractionModule_ProvideRootMatcherFactory.proxyProvideRootMatcher(this.viewInteractionModule), ViewInteractionModule_ProvideNeedsActivityFactory.proxyProvideNeedsActivity(this.viewInteractionModule), ViewInteractionModule_ProvideRemoteInteractionFactory.proxyProvideRemoteInteraction(this.viewInteractionModule), (ListeningExecutorService) DaggerBaseLayerComponent.this.provideRemoteExecutorProvider.get());
        }
    }
}
